package ControlLayer;
import ModelLayer.Customer;
import DBLayer.DBCustomer;
import java.util.ArrayList;

public class CtrCustomer {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrCustomer instance = null;
    DBCustomer dbCustomer = new DBCustomer();

    public CtrCustomer() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrCustomer getInstance() {
        if (instance == null) {
            instance = new CtrCustomer();
        }
        return instance;
    }

    public ArrayList<Customer> getCustomerList() {
        return dbCustomer.getCustomerList();
    }

    public Customer getCustomerByID(int id) {
        return dbCustomer.getCustomerByID(id);
    }

    public int addCustomer(Customer customer) {
        return dbCustomer.addCustomer(customer);
    }

    public int updateCustomer(Customer customer, int id) {
        return dbCustomer.updateCustomer(customer, id);
    }

    public void deleteCustomer(int id) {
        dbCustomer.deleteCustomer(id);
    }
    // </editor-fold>
}
